package cool.taomu.toolkit.cacheable

import com.google.inject.AbstractModule
import cool.taomu.toolkit.Taomu
import cool.taomu.toolkit.utils.ProxyUtils
import org.junit.jupiter.api.Test

class CacheableTest {

    @Cacheable
    def String b() {
        return "Hello World CacheableTest";
    }

    @Test
    def void a() {
        var a = Taomu.injector.createChildInjector(new AbstractModule() {
            override configure() {
                bind(CacheableTest)
            }
        })
        var t = a.getInstance(CacheableTest)
        ProxyUtils.isProxy(t)
        println(t.b());
        println(t.b());
    }
}
